{{extend 'layout.html'}}
{{def pad(text):}}
{{items = text.split('.')}}
{{return items[0]+('...' if len(items)>4 else '.')+'.'.join(items[-3:])}}

<div class="ui-body ui-body-c ui-corner-all">
  <h3>Ensemble: {{=request.vars.path}}</h3>

</div>
  
{{okey=''}}
<ul data-role="listview" data-inset="true">
  {{for row in rows:}}
  {{items = row.key.split('.',1)}}
  {{k,kk = items if len(items)==2 else (items, items)}}
  {{if okey!=k:}}
  <li data-role="list-divider">{{=k}}</li>
  {{pass}}
  <li style="height: 2em">{{=pad(kk)}}:<br/><span style="color: brown;float:right">{{=row.value}}</span></li>
  {{okey=k}}
  {{pass}}
</ul>

<ul data-role="listview" data-inset="true">
  <li data-role="list-divider">Files in ensenble</li>
  {{if files:}}
  {{for f in files:}}
  <li><a href="{{=URL('file_info',vars=dict(path=f))}}">{{=f}}</a></li>
  {{pass}}
  {{else:}}
  <li>Cannot locate files, probably service is down</li>  
  {{pass}}
</uL>

